<template>
  <div id="restaurant">
    <keep-alive>
      <router-view v-if="$route.meta.keepAlive"></router-view>
    </keep-alive>
    <router-view v-if="!$route.meta.keepAlive"></router-view>
  </div>
</template>

<script>
export default {
  name: 'Restaurant',
  data() {
    return {
      enterpriseData: {
        enterpriseId: "496f8b9d179748e28cb9fbe4960db9d1",
        enterpriseName: '巴拉巴拉酒店',
        employName: '赵华',
        enterpriseEmployId: 'f6450810b49540f98de6aecfd113beb8',
        enterpriseDeptId: 'e1e924c926644345924d19310b45e72a',
        enterprisePostId: '88c29a22c286426792744da88137cbf0',
      },
      userData: {}
    }
  },
  components: {},
  mounted() {
    /**
     * 获取用户信息
     */
    this.$wl.getUserInfo({
      id: 201,
      success: (res) => {
        console.log('用户信息:' + JSON.stringify(res));
        if (typeof res == 'string') {
          this.$store.commit('setUserInfo', JSON.parse(res));
        } else {
          this.$store.commit('setUserInfo', res);
        }
      }
    });
    /**
     * 获取企业信息
     */
    this.$wl.getDefaultEnterprise({
      id: 201,
      success: (res) => {
        console.log('企业信息:' + JSON.stringify(res));
        if (typeof res == 'string') {
          this.$store.commit('setEnterprise', JSON.parse(res));
        } else {
          this.$store.commit('setEnterprise', res);
        }
      }
    });

    this.$store.commit('setEnterprise', this.enterpriseData);

  }
}
</script>
<style scoped>
  #restaurant{
    height: 100%;
  }
</style>


